package com.zjhb.entity;

import java.util.Objects;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.GenericGenerator;

import com.zjhb.common.util.StringMyUtil;

@javax.persistence.Entity
@javax.persistence.Table(name = "file", schema = "army", catalog = "")
public class FileEntity {
	private String id;
	private String fileId;
	private String createTime;
	private String tableName;
	private String name;

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "ID")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@javax.persistence.Basic
	@javax.persistence.Column(name = "file_id")
	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	@javax.persistence.Basic
	@javax.persistence.Column(name = "create_time")
	public String getCreateTime() {
		return StringMyUtil.dateTimeSplit(createTime);
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	@javax.persistence.Basic
	@javax.persistence.Column(name = "table_name")
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;
		FileEntity that = (FileEntity) o;
		return Objects.equals(id, that.id) && Objects.equals(fileId, that.fileId)
				&& Objects.equals(createTime, that.createTime) && Objects.equals(tableName, that.tableName);
	}

	@Override
	public int hashCode() {

		return Objects.hash(id, fileId, createTime, tableName);
	}
}
